package main

import (
	"flag"
	"fmt"
	"os"
)

var name string

//func init(){
//	flag.StringVar(&name,"name","huran","the greeting object")
//}
func init() {
	flag.CommandLine=flag.NewFlagSet("",flag.ExitOnError)
	flag.CommandLine.Usage= func() {
		fmt.Fprintf(os.Stderr,"Usage of %s :\n","question")
		flag.PrintDefaults()
	}
}
func main() {
	var name=getTheFlag()
	Hello("sds")
	//方式一
	//flag.Usage= func() {
	//	fmt.Fprintf(os.Stderr,"Usage of %s:\n","question")
	//	flag.PrintDefaults()
	//}
	//方式二

	flag.Parse()
	fmt.Printf("hello %v\n",*name)
}
func getTheFlag()*string{
	return flag.String("name","everyone","this is huran")
}